<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:74:"D:\myphp\PHPTutorial\WWW\fresher\conf/../template/admin\shop_showedit.html";i:1535336324;s:74:"D:\myphp\PHPTutorial\WWW\fresher\conf/../template/admin\common_header.html";i:1534901852;s:74:"D:\myphp\PHPTutorial\WWW\fresher\conf/../template/admin\common_footer.html";i:1534140541;}*/ ?>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="__HLIB__html5shiv.js"></script>
<script type="text/javascript" src="__HLIB__respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="__HSTATIC__h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__HSTATIC__h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__HLIB__Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__HSTATIC__h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="__HSTATIC__h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="__HLIB__DD_belatedPNG_0.0.8a-min.js" ></script>

<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<style>
    #edui1_bottombar{
        display: none;
    }
</style>

    <title>添加文章</title>
    <style>
        .anchorBL>a{
            display: none !important;
        }
        .anchorBL>span{
            display: none !important;
        }

    </style>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="__ACSS__bootstrap.css"/>
</head>
<body>
<div class="page-container">
    <form action="<?php echo Url('edit'); ?>" method="post" class="form form-horizontal" id="form">
        <input type="hidden" class="input-text" value="<?php echo $data['id']; ?>" name="id">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>商家账号：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="text" class="input-text" value="<?php echo $data['shop_username']; ?>" placeholder="" id="articletitle"  maxlength="15"   name="shop_username" datatype="*" nullmsg="文章标题为空！">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1">商家logo：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="file" class="input-text" value="" placeholder="" id="articletitle2" name="coverFile">
            </div>
            <?php if($data['shop_logo']): ?>
            已上传，<a href="javascript:void(0);"  onclick="previewPictures('__UPS__'+'<?php echo $data['shop_logo']; ?>')" style="color: red;text-decoration: none;">预览</a>
            <?php endif; ?>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>商户经营类别：</label>
            <div class="formControls col-xs-8 col-sm-10">
                 <select  name="classify_id[]"   title="请选择经营类别" id="selectpicker"  class="selectpicker form-control " multiple data-live-search="false">
                     <?php $ids=explode(',',$data['classify_id']); $_result=getlists('classify');if(is_array($_result) || $_result instanceof \think\Collection || $_result instanceof \think\Paginator): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                            <option value="<?php echo $v['id']; ?>" <?php if(in_array($v['id'],$ids)): ?>selected<?php endif; ?>><?php echo $v['classify_name']; ?></option>
                      <?php endforeach; endif; else: echo "" ;endif; ?>
                 </select>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>商户名称：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="text" class="input-text" value="<?php echo $data['shop_name']; ?>" placeholder=""   maxlength="30"    name="shop_name" datatype="*" nullmsg="文章标题为空！">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>商户联系人：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="text" class="input-text" value="<?php echo $data['shop_person']; ?>" placeholder="请输入商户联系人"  maxlength="20"   name="shop_person" datatype="*" nullmsg="文章标题为空！">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>商户联系电话：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="text" class="input-text" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" value="<?php echo $data['shop_tel']; ?>" placeholder="请输入手机号" maxlength="11"  name="shop_tel" datatype="m" nullmsg="请输入手机号" errormsg="请输入正确的手机号">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>所属省：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <span class="select-box">
                    <select name="shop_pid"  id="shoppid"  class="select" datatype="*" nullmsg="请选择省" >
                       <option disabled selected value="0">请选择省</option>
                        <?php $_result=getlists('province');if(is_array($_result) || $_result instanceof \think\Collection || $_result instanceof \think\Paginator): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                              <option value="<?php echo $v['id']; ?>" <?php if($v['id'] == 1): ?>selected<?php endif; ?>><?php echo $v['p_name']; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                     </select>
				</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>所属市：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <span class="select-box">
                    <select name="shop_cid" id="shopcid"  class="select" datatype="*" nullmsg="请选择市" >
                        <?php $_result=getlists('city');if(is_array($_result) || $_result instanceof \think\Collection || $_result instanceof \think\Paginator): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                              <option value="<?php echo $v['id']; ?>" <?php if($v['id'] == 1): ?> selected<?php endif; ?>><?php echo $v['c_name']; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                     </select>
				</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>所属县区：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <span class="select-box">
                   <select name="shop_aid"  id="shopaid" class="select" datatype="*" nullmsg="请选县区" onchange="solution(1)" >
                            <option disabled selected value="0">请选县区</option>
                        <?php $_result=getlists('area');if(is_array($_result) || $_result instanceof \think\Collection || $_result instanceof \think\Paginator): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                              <option value="<?php echo $v['id']; ?>"  <?php if($v['id'] ==  $data['shop_aid']): ?> selected<?php endif; ?>><?php echo $v['a_name']; ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                   </select>
				</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>详细地址:</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" id="address" value="<?php echo $data['shop_address']; ?>"  name="shop_address" datatype="*" nullmsg="详细地址不能为空！">
            </div>
            <div class="formControls col-sm-2">
              <button class="btn btn-primary radius" type="button" onclick="solution(2)">定位</button>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1">定位坐标：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="text" id="loction" name="shop_location"  class="input-text" value="<?php echo $data['shop_location']; ?>">

            </div>
        </div>      <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1">商家地图：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <div id="map" class="map" style="height:500px;width: 100%"></div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1">商家简介：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <textarea name="shop_intro" cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" datatype="*"  nullmsg="文章摘要不能为空！" ><?php echo $data['shop_intro']; ?></textarea>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1">商家详情：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <textarea  id="content" name="shop_content" cols="30" rows="10" style="width:100%;height:400px;"><?php echo $data['shop_content']; ?></textarea>
                <!--<script id="editor" type="text/plain" style="width:100%;height:400px;"></script>-->
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-10 col-xs-offset-4 col-sm-offset-1">
                <button class="btn btn-primary radius" type="submit"> 提交审核</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="__HLIB__jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__HLIB__layer/2.4/layer.js"></script>
<script type="text/javascript" src="__HSTATIC__h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__HSTATIC__h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="__HLIB__laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__HLIB__Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__HLIB__layer/2.4/layer.js"></script>
<script type="text/javascript" src="__HSTATIC__h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__AJS__common.js"></script>
<script type="text/javascript" src="__HLIB__ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="__HLIB__ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="__HLIB__ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="__HLIB__My97DatePicker/4.8/WdatePicker.js"></script>

<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=KisQvBv8QGvf9IpIGfA2rkudfCfZND6V"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/js/bootstrap-select.min.js"></script>
</body>
<script type="text/javascript">
    $(function () {
        UE.getEditor('content');
        maps();
    });
//    $('.selectpicker').selectpicker({
//        noneSelectedText: '请选择经营类别' //默认显示内容
//    });

    var paddress =jQuery("#shoppid  option:selected").text();
    var caddress =jQuery("#shopcid  option:selected").text();
    var map = new BMap.Map("map");
    var point = new BMap.Point();//地图初始位置
    map.centerAndZoom(point,12);//默认地图级别12级
    map.setDefaultCursor("url('bird.cur')");   //设置地图默认的鼠标指针样式
    map.enableScrollWheelZoom();   //启用滚轮放大缩小，默认禁用
    map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
    var myGeo = new BMap.Geocoder();
    function maps(){
        var addres="<?php echo $data['shop_address']; ?>";
        if(!addres){
            $('#address').val(paddress+caddress);
        }else{
            $('#address').val(addres);
        }
        //单击获取点击的经纬度;
        var myGeo = new BMap.Geocoder();
        map.addEventListener("click",function(e){
            $('#location').val(e.point.lng + ", " + e.point.lat);
            map.clearOverlays();
            var x = e.point.lng;
            var y = e.point.lat;
            var ggPoint = new BMap.Point(x,y);
            map.addControl(new BMap.NavigationControl());
            var markergg = new BMap.Marker(ggPoint);
            map.addOverlay(markergg); //添加GPS坐标
            var labelgg = new BMap.Label("",{offset:new BMap.Size(2,2)});
            markergg.setLabel(labelgg); //添加GPS label
            map.setDefaultCursor("url('bird.cur')");     //设置鼠标形状为手型
            var pt = e.point;
            myGeo.getLocation(pt, function(rs){
                var addresses=rs.address;
                $('#address').val(addresses);
                $('#loction').val(rs.point.lng+','+rs.point.lat);
            });
        });
        if("<?php echo $data['shop_location']; ?>"){
            solution(2);
        }else{
            solution(3);
        }
    }
     var locaddress="";
    function solution(type){
        var aaddress =jQuery("#shopaid  option:selected").text();
        if(type==1){
            locaddress=paddress+caddress+aaddress;
            $('#address').val(locaddress);
        }else if(type==2){
            locaddress= $('#address').val();
        }else{
            locaddress=paddress+caddress;
        }
        map.clearOverlays();
        // 将地址解析结果显示在地图上,并调整地图视野
        myGeo.getPoint(locaddress, function(point){
            if (point) {
                map.centerAndZoom(point, 16);
                map.addOverlay(new BMap.Marker(point));
             $('#loction').val(point.lng+','+point.lat);
            }else{
                layer.msg("您选择地址没有解析到结果!");
            }
        }, "北京市");
    }
</script>
</html>